import QtQuick 2.7
import QtQuick.Controls 2.0
import QtQuick.Dialogs 1.2

Item {
    MessageDialog {
        id: messageDialog
        objectName: "PagePluginExampleMessageDialog"
        text: "Label Text: "+label.text
    }

    Column {
        id: column
        spacing: 40
        width: parent.width

        Label {
            id: label
            objectName: "PagePluginExampleLabel"
            width: parent.width
            wrapMode: Label.Wrap
            horizontalAlignment: Qt.AlignHCenter
            text: "This is a Label."
        }
        TextField {
            id: textField
            width: parent.width
            horizontalAlignment: Qt.AlignHCenter
            text: "This is a TextField."
        }

        Column {
            spacing: 20
            anchors.horizontalCenter: parent.horizontalCenter

            Button {
                text: "Load text to Label and \nCacheText from TextField"
                onClicked: {
				    console.log(PagePluginExample,textField.text)
				    PagePluginExample.loadText(textField.text)
				}
            }
            Button {
                id: button
                text: "Load text to TextField from CacheText"
                highlighted: true
                onClicked: textField.text = PagePluginExample.getCacheText()
            }
            Button {
                text: "Open MessageDialog"
                onClicked: PagePluginExample.openDialog()
            }
        }
    }
}
